#ifndef CENTRALWIDGET_H
#define CENTRALWIDGET_H

#include <QWidget>
#include "PlaceManger.h"
#include "mytool.h"
#include <QLabel>
class MainWindow;
class CentralWidget : public QWidget
{
    Q_OBJECT
public:
    friend class MainWindow;
    explicit CentralWidget(QWidget *parent = 0);
    void setFlagName(char *name);
protected:
    void paintEvent(QPaintEvent *event);
signals:
    void sendLength(int);
    void sendGJNode(gjlx*,int,gjlx*,int);
    void sendAll(int,gjlx*,int,gjlx*,int);
public slots:
    void Planing(int,int,int,int);
    void GJPlaning(int,int,int,int,int);
    void AllPlaning(int,int,int,int);
    void flagPlace(char *name);
private:
    char flagName[50];
    void paintMap();
    void paintB();
    void paintBus();
    void paintMinBus();
    pathNode *path;
    gjlx *path2;
    gjlx *path3;
    int length1;
    int length2;
    int length3;
    int x1;
    int y1;
    int x2;
    int y2;
    int type;

    PlaceManger PM;
    int space;
    int offsetX;
    int offsetY;

};

#endif // CENTRALWIDGET_H
